package cc.lishiwei.spring.social.wechat.connect;

import cc.lishiwei.spring.social.wechat.api.Wechat;
import static org.springframework.social.facebook.api.GraphApi.GRAPH_API_URL;
import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
import org.springframework.social.oauth2.OAuth2Operations;
import org.springframework.social.oauth2.OAuth2Template;

/**
 *
 * @author alexl
 */
public class WechatServiceProvider extends AbstractOAuth2ServiceProvider<Wechat> {
    private static final String API_VERSION = Wechat.DEFAULT_API_VERSION;

    public WechatServiceProvider(OAuth2Operations oauth2Operations) {
        super(oauth2Operations);
    }

    @Override
    public Wechat getApi(String string) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
    
    private static OAuth2Template getOAuth2Template(String appId, String appSecret) {
		OAuth2Template oAuth2Template = new OAuth2Template(appId, appSecret,
				"https://www.facebook.com/v" + API_VERSION + "/dialog/oauth",
				GRAPH_API_URL + "oauth/access_token");
		oAuth2Template.setUseParametersForClientAuthentication(true);
		return oAuth2Template;
	}

}
